package com.pinda.service.impl;

import com.pinda.auth.entity.PdAuthMenu;
import com.pinda.auth.view.PdAuthMenuView;
import com.pinda.mapper.PdAuthMenuMapper;
import com.pinda.mapper.PdAuthResourceMapper;
import com.pinda.service.IPdAuthMenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 菜单 服务实现类
 * </p>
 *
 * @author 黄杰
 * @since 2023-06-13
 */
@Service
public class PdAuthMenuServiceImpl extends ServiceImpl<PdAuthMenuMapper, PdAuthMenu> implements IPdAuthMenuService {
    @Resource
    private PdAuthMenuMapper pdAuthMenuMapper;

    @Resource
    private PdAuthResourceMapper pdAuthResourceMapper;

    @Override
    public PdAuthMenuView findMenuResourcesService() {
        return PdAuthMenuView
                .builder()
                .menus(this.pdAuthMenuMapper.selectList(null))
                .resources(this.pdAuthResourceMapper.selectList(null))
                .build();
    }
}
